Security News
Bun 1.2 Released with 90% Node.js Compatibility and Built-in S3 Object Support
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
Utilities for cloning, extending, and de-referencing objects in shallow, deep, and safe ways
Utilities for cloning, extending, and de-referencing objects in shallow, deep, and safe ways
npm install --save extendr
// Shallow Clone
(function(){
var a = {a:1}, b = {b:2}
var c = require('extendr').clone(a,b)
console.log(a) // {a:1}
console.log(b) // {b:2}
console.log(c) // {a:1,b:2}
})()
// Shallow Extend
(function(){
var a = {a:1}, b = {b:2}
var c = require('extendr').extend(a,b)
console.log(a) // {a:1,b:2}
console.log(b) // {b:2}
console.log(c) // {a:1,b:2}
})()
clone(args...)
- shallow extend the arguments into a new object, same as extend({},args...)
deepClone(args...)
- deep extend the arguments into a new object, same as deepExtend({},args...)
dereference(obj)
- return a copy of the object with all references destroyed, same as serializing then deserializing the objectextend(args...)
- alias for shallowExtendPlainObjects
deepExtend(args...)
- alias for deepExtendPlainObjects
shallowExtendPlainObjects(target, args...)
- shallow extend the arguments into the targetdeepExtendPlainObjects(target, args...)
- deep extend the arguments into the targetsafeShallowExtendPlainObjects(target, objs...)
- shallow extend defined values from the arguments into the targetsafeDeepExtendPlainObjects(target, args...)
- deep extend defined values from the arguments into the targetnull
and undefined
values to overwrite a defined valuesYou can discover the history inside the History.md file
Licensed under the incredibly permissive MIT License
Copyright © 2013+ Bevry Pty Ltd
Copyright © 2011-2012 Benjamin Arthur Lupton
v2.1.0 2013 June 29
FAQs
Utilities for cloning, extending, and de-referencing objects in shallow, deep, and safe ways
The npm package extendr receives a total of 27,344 weekly downloads. As such, extendr popularity was classified as popular.
We found that extendr demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
Security News
Biden's executive order pushes for AI-driven cybersecurity, software supply chain transparency, and stronger protections for federal and open source systems.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.